<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../public/css/basic.css"/>
    <link rel="stylesheet" href="../public/layui/css/layui.css"/>
    <link rel="stylesheet" href="../public/layui/css/modules/layer/default/layer.css"/>
    <link rel="stylesheet" href="../public/css/manage.css"/>
    <script src="../public/js/jquery-1.11.1.min.js"></script>
    <title>新增政府机构</title>
    <style>
        body{min-width: 500px}
    </style>
</head>
<body>

<form action="" class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 120px">政府机构名称</label>
        <div class="layui-input-block" style="margin-left: 160px">
            <input type="text" placeholder="请输入政府机构名称" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 120px">政府机构所在地</label>
        <div class="layui-input-block" style="margin-left: 160px">
            <div class="layui-input-inline"  >
                <select id="province" name="org_province" lay-filter="org_province"></select>
            </div>
            <div class="layui-input-inline" >
                <select id="city" name="org_city" lay-filter="org_city"></select>
            </div>
            <div class="layui-input-inline">
                <select id="area" name="org_area" lay-filter="org_area"></select>
            </div>
        </div>

    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 120px">政府机构状态</label>
        <div class="layui-input-block"  style="margin-left: 160px">
            <input type="radio" name="zt" value="正常" title="正常" checked="">
            <input type="radio" name="zt" value="禁用" title="禁用">
        </div>
    </div>
    <div class="but1-mid">
        <button class="layui-btn bc">保存</button>
    </div>
</form>

<script src="../public/layui/layui.js"></script>
<script type="text/javascript" src="../public/js/area.js"></script>
<script>

    layui.use(['form'], function() {
        var form = layui.form;

    })

//城市三级联动
    var mypcas = new PCAS("org_province", "org_city", "org_area", "请选择省份", "请选择城市", "请选择地区");
    layui.use(['form'], function() {
        var form = layui.form;
        var province;
        form.on('select(org_province)', function(data) {
            province = data.value;
            //layui高版本不清除会出现选项重复
            document.getElementById("province").innerHTML="";
            document.getElementById("city").innerHTML="";
            document.getElementById("area").innerHTML="";
            var mypcas = new PCAS("org_province", "org_city", "org_area", province, "请选择城市", "请选择地区");
            form.render('select');
        });
        form.on('select(org_city)', function(data) {
            //layui高版本不清除会出现选项重复
            document.getElementById("province").innerHTML="";
            document.getElementById("city").innerHTML="";
            document.getElementById("area").innerHTML="";
            var mypcas = new PCAS("org_province", "org_city", "org_area", province, data.value, "请选择地区");
            form.render('select');
        });
    });

</script>


</body>
</html>